package com.xmb.common.service.impl;

import com.xmb.common.entity.structure.PayOrderInfo;
import com.xmb.common.params.WxPayUnifiedOrdeParam;

import javax.annotation.PostConstruct;

/**
 * Created by lyndon on 2019/3/27.
 */
public abstract class GetPayOrderStrategy {

    private GetPayOrderStrategyHolder context;

    @PostConstruct
    void init() {
        this.register();
    }

    private void register() {
        if (context == null) {
            context = GetPayOrderStrategyHolder.getSingleton();
        }
        context.registerStrategy(this);
    }

    public abstract PayOrderInfo process(WxPayUnifiedOrdeParam payParam);

    public abstract String getType();
}
